<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>测试---项目---智能办公系统</title>
    <!-- 引入样式 -->
    <link rel="stylesheet" th:href="@{/static/css/theme-chalk.css}">

    <link rel="stylesheet" th:href="@{/static/css/awe.css}">

    <link rel="stylesheet" th:href="@{/static/css/index.css}" />

    <link rel="shortcut icon" th:href="@{/static/icon/favicon.ico}" />
    <link rel="bookmark"  th:href="@{/static/icon/favicon.ico}"  />

    <style  type="text/css">
        [v-cloak] {
            display: none;
        }
    </style>

</head>
<body>
    <div id="app"  v-cloak>
        <el-container>

 <!-- 添加侧边栏 -->
  <div id="menu-form-div"  ></div>

            <el-container>

<!-- 添加头部 -->
<div id="head-form-div"  ></div>

                <!-- 主要内容区域 -->
                <el-main>
                    <div class="container">


 <!-- 查询模块 -->
<div id="query-form-div"  ></div>
<!-- 表格 -->
<div id="table-form-div"  ></div>



<!--  foot-->
 <div id="foot-form-div"  ></div>

 <!-- 对话框 -->
<div id="dialog-form-div"  ></div>



                    </div>
                </el-main>
            </el-container>
        </el-container>
    </div>


    <!-- 引入 Vue -->
    <script th:src="@{/static/js/vue.js}"></script>
    <!-- 引入 ElementUI -->
    <script th:src="@{/static/js/element-ui.js}"></script>
    <!-- 引入 ECharts -->
    <script th:src="@{/static/js/echarts.common.min.js}"></script>
    <!-- 引入 Moment.js -->
    <script th:src="@{/static/js/moment.js}"></script>
    <!-- 引入 Axios -->
    <script th:src="@{/static/js/axios.js}"></script>
    <!-- 引入 vue-clipboard.min.js -->
    <script th:src="@{/static/js/vue-clipboard.min.js}"></script>

    <script th:src="@{/static/js/const.js}"></script>

    <script th:src="@{/static/js/tool.js}"></script>

    <script th:src="@{/static/js/axi.js}"></script>

    <script th:src="@{/static/js/app/project/web/open/vuewz.js}"></script>
    <script th:src="@{/static/js/app/project/web/open/vuemethod.js}"></script>

    <script th:inline="text">
            function gogogo() {
                new Vue({
                    el: '#app',
                    data() {
                        const complex = {
                            pre: '[[${pre}]]',
                            a: '[[${a}]]',
                            b: '[[${b}]]',
                            c: '[[${c}]]',
                            tokenJson: '',
                            tokenObject: '[[${tokenObject}]]',
                            sysinfoMicroId: '[[${sysinfoMicroId}]]',
                            deploy: '[[${deploy}]]',
                            //
                            abc: {
                                micro: {} ,  // 微服务
                                module: {},  // 模块
                                entity: {},  // 实体
                            },
                            currentUploadId: 0,
                            dialogLoading: false,
                            dialogTitle: '新增',
                            showBtnDialogFormSubmit: false,
                            sels: [],
                            uploadHeaders: {
                                'Authorization': 'Bearer Wang-Zhou-Token:' + '[[${tokenComplex}]]',
                            },

                            dicts: [
                                {name: '发布平台', tag: '0:platform:#', value: '[[${deploy}]]', list: [], field: 'osDictId'},
                                {name: '部署方式', tag: '0:deploy_way:#', value: 'zip', list: [], field: 'deployTypeDictId'},
                                {name: '技术分类', tag: '0:tech_type:#', value: 'postgres', list: [], field: 'techTypeDictId'},
                            ],

                            fileList: [],

                        }
                        return Object.assign(complex, vuewz)
                    },
                    computed: {
                        completedTodos() {

                        }
                    },
                    watch: {

                    },
                    methods: Object.assign(vuemethod, {
                        // dict_id
                        getDictValue(dictId, index) {
                            return this.dicts[index].list
                                .filter(item => item.id == dictId)[0]
                                .name
                        },
                        // methods
                        handleSelectionChangeTable(val) {
                            this.sels = val
                        },

                        selectChangedTo(val, index) {
                            console.log(val, index)
                            this.dicts[index].value = this.dicts[index].list.filter(item => item.id == val)[0].name
                        },

                        fileUploadSuccess(response, file, fileList) {
                            this.fileList = [file]
                            if (response.code == 200) {
                                // response.data
                                axi.get(this,  '/project/test/port' + '/valid_file'  , { file: response.data },  data => {
                                    if (data ) {
                                        axi.get(this,  '/project/test/port' + '/password/' + this.currentUploadId , {  },  data => {
                                            if (data) {
                                                this.passwordForm.password = data.password
                                                this.passwordForm.username = data.username
                                            }
                                        })
                                    }
                                })
                            } else {
                                this.$message.error(response.msg)
                            }
                        },

                        copyText(text) {
                            this.$copyText(text)
                                .then(e => this.$message.success('复制成功！'),
                                    e => this.$message.error('操作异常!'))
                        },


                    }),
                    mounted() {
                        this.loadToken()
                        this.loadMenus()
                        this.loadRole()
                        this.loadAbc()
                        this.loadDict()
                        //


                    }
                })
            }

            //
            async  function loadHtmlContent(parts) {
                for (let i = 0; i < parts.length; i++) {
                    const res = await axios.get('[[${pre}]]/html/[[${a}]]/[[${b}]]/[[${c}]]/' + parts[i]  + '/[[${token}]]?t=1741040995598&sysinfoMicroId=[[${sysinfoMicroId}]]' + "&page=" + parts[i])
                    window.document.getElementById(parts[i] + '-form-div').outerHTML = res.data
                }
            }
            // 创建一个 axios 实例
            (async () => {
                const parts = vuewz.parts
                await loadHtmlContent(parts)
                // 调用 gogogo 函数
                gogogo()
            })()


    </script>
</body>
</html>

